package org.jeecg.modules.flow.api.factory;

import feign.hystrix.FallbackFactory;
import org.jeecg.modules.flow.api.FlowBaseCloudApi;
import org.jeecg.modules.flow.api.fallback.FlowBaseCloudApiFallback;
import org.springframework.stereotype.Component;

/**
 * @Author: zzq
 */
@Component
public class FlowBaseCloudApiFallbackFactory implements FallbackFactory<FlowBaseCloudApi> {
    @Override
    public FlowBaseCloudApi create(Throwable throwable) {
        FlowBaseCloudApiFallback flowApiFallback = new FlowBaseCloudApiFallback();
        flowApiFallback.setCause(throwable);
        return flowApiFallback;
    }
}
